package com.myframe.www.example;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.bumptech.glide.Glide;
import com.myframe.www.R;
import com.myframe.www.base.BaseActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;

public class JcvdActivity extends BaseActivity {


    @Bind(R.id.videoplayer)
    JCVideoPlayerStandard mVideoplayer;

    @Override
    protected void initToolbar() {
        mToolbar.setTitle("JCVD");
    }

    public static void start(Activity activity) {
        Intent intent = new Intent(activity, JcvdActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected int getContentViewLayoutId() {
        return R.layout.activity_jcvd;
    }

    @Override
    protected void onViewCreated(Bundle savedInstanceState) {

        }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
        mVideoplayer.setUp("http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4", JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "嫂子闭眼睛");
        Glide.with(this).load("http://img4.jiecaojingxuan.com/2016/8/17/f2dbd12e-b1cb-4daf-aff1-8c6be2f64d1a.jpg").into(mVideoplayer.thumbImageView);
        // mVideoplayer.thumbImageView.setImage("http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640");
    }


    @OnClick({R.id.videoplayer, R.id.btn_small_video})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.videoplayer:
                break;
            case R.id.btn_small_video:
                mVideoplayer.startWindowTiny();
                break;
        }
    }
}
